package com.gowants.pems.mapper;

import com.gowants.pems.model.EquipmentFault;
import com.gowants.pems.model.EquipmentFaultFile;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EquipmentFaultMapper {

    /**
     * 检索 设备警告
     * @param record
     * @return
     */
    public List<EquipmentFault> select(@Param("record") EquipmentFault record);

    /**
     * 根据id就检索
     * @param id
     * @return
     */
    public EquipmentFault selectById(String id);

    /**
     * 根据pid 检索文件
     * @param id
     * @return
     */
    public List<EquipmentFaultFile>selectFile(String id);

    /**
     * 插入 设备警告
     * @param record
     * @return
     */
    public int insert(EquipmentFault record);

    /**
     *  修改设备警告
     * @param record
     * @return
     */
    public int update(@Param("record") EquipmentFault record);

    /**
     * 删除设备警告
     * @param id
     * @return
     */
    public int delete(String id);

    /**
     * 插入文件
     * @param list
     * @return
     */
    public int insertFile(List<EquipmentFaultFile> list);

    /**
     *根据pid 删除
     * @param pid
     * @return
     */
    public int deleteFileByPid(String pid);

    /**
     * 根据 address 删除
     * @param address
     * @return
     */
    public int deleteFileByAddress(String address);


    public int selectByAddress(String address);

}
